@echo off
REM Windows启动脚本

echo 🚀 启动人脸质量检测API服务...

REM 检查Python
where python >nul 2>nul
if %errorlevel% neq 0 (
    echo ❌ Python未安装
    exit /b 1
)

REM 创建虚拟环境
if not exist "venv" (
    echo 🔧 创建虚拟环境...
    python -m venv venv
)

REM 激活虚拟环境
echo 🔧 激活虚拟环境...
call venv\Scripts\activate.bat

REM 安装依赖
echo 📥 安装依赖...
pip install -r requirements.txt

REM 创建目录
echo 📁 创建目录...
if not exist "models" mkdir models
if not exist "uploads" mkdir uploads
if not exist "logs" mkdir logs
if not exist "static" mkdir static

REM 检查.env文件
if not exist ".env" (
    echo ⚠️  .env文件不存在，从.env.example复制...
    copy .env.example .env
)

REM 启动服务
echo ✅ 启动服务...
uvicorn api:app --host 0.0.0.0 --port 8000 --reload

